package com.mfin.bom.objects;

// Generated 17 Jun, 2012 11:27:33 PM by Hibernate Tools 3.4.0.CR1
import static javax.persistence.GenerationType.IDENTITY;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Partner generated by hbm2java
 */
@Entity
@Table(name = "partner", catalog = "mfindb")
public class Partner implements java.io.Serializable {

	private Long id;
	private Customer customer;
	private Finance finance;
	private Set<FinanceChit> financeChits = new HashSet<FinanceChit>(0);
	private Set<FinanceLoan> financeLoans = new HashSet<FinanceLoan>(0);
	private Set<Cashbook> cashbooks = new HashSet<Cashbook>(0);

	public Partner() {
	}

	public Partner(Customer customer, Finance finance,
			Set<FinanceChit> financeChits, Set<FinanceLoan> financeLoans,
			Set<Cashbook> cashbooks) {
		this.customer = customer;
		this.finance = finance;
		this.financeChits = financeChits;
		this.financeLoans = financeLoans;
		this.cashbooks = cashbooks;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CUSTOMER_ID")
	public Customer getCustomer() {
		return this.customer;
	}

	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FINANCE_ID")
	public Finance getFinance() {
		return this.finance;
	}

	public void setFinance(Finance finance) {
		this.finance = finance;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "partner")
	public Set<FinanceChit> getFinanceChits() {
		return this.financeChits;
	}

	public void setFinanceChits(Set<FinanceChit> financeChits) {
		this.financeChits = financeChits;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "partner")
	public Set<FinanceLoan> getFinanceLoans() {
		return this.financeLoans;
	}

	public void setFinanceLoans(Set<FinanceLoan> financeLoans) {
		this.financeLoans = financeLoans;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "partner")
	public Set<Cashbook> getCashbooks() {
		return this.cashbooks;
	}

	public void setCashbooks(Set<Cashbook> cashbooks) {
		this.cashbooks = cashbooks;
	}

}
